package com.newviews.tcmip.web.controller;

import com.newviews.tcmip.common.model.PageModel;
import com.newviews.tcmip.common.model.ResultModel;
import com.newviews.tcmip.service.inf.EtcmPxTreatiseServiceInf;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 * 处方-文献关系表 前端控制器
 * </p>
 *
 * @author lxc
 * @since 2024-03-08
 */
@RestController
@RequestMapping("/etcmPxTreatisePo")
@Api(tags = "处方-文献关系表")
public class EtcmPxTreatiseController {
    @Resource
    private EtcmPxTreatiseServiceInf etcmPxTreatiseServiceInf;

    @GetMapping("/page")
    @ApiOperation("获取处方文献")
    public ResultModel<PageModel<Map<String,String>>> getInfo(
            @RequestParam String uiTypeCode,
            @RequestParam String langCode,
            @RequestParam(required = false) String treatiseType,
            @RequestParam(required = false, defaultValue = "1") Integer pageNo,
            @RequestParam(required = false, defaultValue = "10") Integer pageSize){
        return etcmPxTreatiseServiceInf.getPage(treatiseType, uiTypeCode, langCode, pageNo, pageSize);
    }
}
